Skip to content

Update onflow/go-ethereum to latest v1.16.2 - #855

Merged
m-Peter merged 3 commits into
mainfrom
mpeter/update-geth
Aug 8, 2025
Merged

Update onflow/go-ethereum to latest v1.16.2#855
m-Peter merged 3 commits into
mainfrom
mpeter/update-geth

Conversation

@m-Peter

@m-Peter m-Peter commented Jul 29, 2025

Copy link
Copy Markdown
Collaborator

Work Towards: #840

Description

This includes performance optimizations, new fields in certain JSON-RPC endpoints, new fields in certain native tracers as well as a new native tracer.


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the standards mentioned here.
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

Summary by CodeRabbit

  • New Features

    • Log entries now include the block timestamp, providing more detailed information when retrieving logs.
  • Bug Fixes

    • Improved error handling during effective gas price calculation for transactions, enhancing reliability.
  • Tests

    • Updated tests to ensure blocks are stored before receipts, aligning test setup with data dependencies.
    • Modified test expectations to include the blockTimestamp field in log entries.
  • Chores

    • Upgraded multiple dependencies to newer versions for improved stability and compatibility.
    • Refactored receipt creation in test mocks to use block objects directly.

@coderabbitai

coderabbitai Bot commented Jul 29, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This update introduces dependency version bumps in both main and test go.mod files, refactors receipt creation and storage logic to ensure block data is present before receipts, enriches logs with block timestamps, and updates related tests and mocks accordingly. Error handling in transaction event decoding is improved.

Changes

Cohort / File(s) Change Summary
Dependency Upgrades
go.mod, tests/go.mod
Upgraded direct and indirect dependencies, added and removed several indirect modules, and updated Flow ecosystem modules and related libraries to newer versions.
Receipt and Block Data Consistency
storage/index_test.go, storage/mocks/mocks.go, storage/pebble/receipts.go
Refactored receipt creation to require a block instance, enforced storing blocks before receipts in tests, and enriched logs with block timestamps. Updated mocks and internal storage logic accordingly.
Transaction Event Decoding Robustness
models/transaction.go
Improved error handling when calculating effective gas price by propagating errors from EffectiveGasTip.
Web3 Log Filter Test Update
tests/web3js/eth_logs_filtering_test.js
Updated expected log objects in tests to include the blockTimestamp field, reflecting new log structure.

Sequence Diagram(s)

sequenceDiagram
    participant Test as Test Suite
    participant BlockIndexer
    participant ReceiptIndexer
    participant Block as Block Model

    Test->>BlockIndexer: Store block (height, ID)
    BlockIndexer-->>Test: Block stored
    Test->>ReceiptIndexer: Create receipt (with stored block)
    ReceiptIndexer->>Block: Access block fields (height, hash, timestamp)
    ReceiptIndexer-->>Test: Receipt stored with block data
Loading
sequenceDiagram
    participant Receipts
    participant Store
    participant Block as Block Model

    Receipts->>Store: Fetch receipts by block height
    Store-->>Receipts: Return receipts bytes
    Receipts->>Store: Fetch block by block height
    Store-->>Receipts: Return block bytes
    Receipts->>Block: Decode block, get timestamp
    Receipts->>Receipts: Assign block timestamp to logs
    Receipts-->>Caller: Return enriched receipts
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Possibly related PRs

Suggested labels

Improvement

Suggested reviewers

  • peterargue
  • zhangchiqing

Poem

In the garden of code where the blockchains grow,
We plant new versions, let dependencies flow.
Receipts and blocks now dance in sync,
With timestamps blooming in every link.
The tests all cheer, the logs are bright—
A bunny’s hop brings code delight! 🐇✨

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5a38173 and aeeac14.

📒 Files selected for processing (4)
  • storage/index_test.go (10 hunks)
  • storage/mocks/mocks.go (1 hunks)
  • storage/pebble/receipts.go (1 hunks)
  • tests/web3js/eth_logs_filtering_test.js (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • tests/web3js/eth_logs_filtering_test.js
  • storage/pebble/receipts.go
  • storage/index_test.go
  • storage/mocks/mocks.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mpeter/update-geth

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@m-Peter
m-Peter force-pushed the mpeter/update-geth branch from 50c0d7b to 61841a3 Compare August 6, 2025 07:55
@m-Peter
m-Peter marked this pull request as ready for review August 6, 2025 08:32
@m-Peter m-Peter changed the title Update onflow/go-ethereum to latest v1.16.1 Update onflow/go-ethereum to latest v1.16.2 Aug 6, 2025
@m-Peter
m-Peter force-pushed the mpeter/update-geth branch from 61841a3 to 5a38173 Compare August 8, 2025 07:02

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 61841a3 and 5a38173.

⛔ Files ignored due to path filters (2)
  • go.sum is excluded by !**/*.sum
  • tests/go.sum is excluded by !**/*.sum
📒 Files selected for processing (7)
  • go.mod (8 hunks)
  • models/transaction.go (1 hunks)
  • storage/index_test.go (10 hunks)
  • storage/mocks/mocks.go (1 hunks)
  • storage/pebble/receipts.go (1 hunks)
  • tests/go.mod (8 hunks)
  • tests/web3js/eth_logs_filtering_test.js (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • tests/web3js/eth_logs_filtering_test.js
  • models/transaction.go
  • storage/mocks/mocks.go
  • go.mod
  • tests/go.mod
  • storage/pebble/receipts.go
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: peterargue
PR: onflow/flow-evm-gateway#617
File: api/stream.go:62-67
Timestamp: 2024-10-18T19:26:37.579Z
Learning: In the `flow-evm-gateway` project, within the Go file `api/stream.go`, the `prepareBlockResponse` method includes the Bloom filter as the field `LogsBloom` in the returned `Block` struct.
📚 Learning: 2024-10-18T19:26:37.579Z
Learnt from: peterargue
PR: onflow/flow-evm-gateway#617
File: api/stream.go:62-67
Timestamp: 2024-10-18T19:26:37.579Z
Learning: In the `flow-evm-gateway` project, within the Go file `api/stream.go`, the `prepareBlockResponse` method includes the Bloom filter as the field `LogsBloom` in the returned `Block` struct.

Applied to files:

  • storage/index_test.go
📚 Learning: 2024-10-17T18:04:04.165Z
Learnt from: peterargue
PR: onflow/flow-evm-gateway#615
File: bootstrap/bootstrap.go:167-197
Timestamp: 2024-10-17T18:04:04.165Z
Learning: In the `flow-evm-gateway` Go project, the validation ensuring that `startHeight` is less than or equal to `endHeight` is performed before the `StartTraceDownloader` method in `bootstrap/bootstrap.go`, so additional checks in this method are unnecessary.

Applied to files:

  • storage/index_test.go
🔇 Additional comments (7)
storage/index_test.go (7)

60-60: LGTM: Pass BlocksIndexer into ReceiptTestSuite

Good wiring. This ensures tests reflect the new receipts → blocks dependency.


280-280: LGTM: Add BlocksIndexer to ReceiptTestSuite

Struct updated consistently with its usage in tests.


289-296: LGTM: Store block in same batch before receipt

Storing the block and receipt in the same batch maintains atomicity and aligns with the new coupling.


305-327: LGTM: Multiple receipts at same height with consistent log indices

Block is stored first in the same batch; receipts and log indices are handled correctly.


341-359: LGTM: Negative case for multiple heights

Correctly expects an error when storing receipts spanning different heights.


366-374: LGTM: GetByTransactionID happy-path setup

Block-first store in same batch is correct; setup matches the updated receipt creation API.


395-402: LGTM: GetByBlockHeight prep and isolation of another block

Block/receipt stored atomically; second, different-height block is isolated in a new batch and committed separately.

Also applies to: 411-417

Comment thread storage/index_test.go
@m-Peter
m-Peter force-pushed the mpeter/update-geth branch from 5a38173 to aeeac14 Compare August 8, 2025 07:14
@m-Peter
m-Peter merged commit a6a9a0a into main Aug 8, 2025
2 checks passed
@m-Peter
m-Peter deleted the mpeter/update-geth branch August 8, 2025 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants